<?php

if(!defined('IN_UCHOME')) {
	exit('Access Denied');
}

@include_once(S_ROOT.'./data/data_profield.php');
require_once(S_ROOT.'./site/libs/func_util.php');

$fid = empty($_GET['fid'])?0:intval($_GET['fid']);

function index()
{
//   echo "hello this is index";
//    exit;
}

if (!isset($ac))
{
    $page = empty($_GET['page'])?1:intval($_GET['page']);
    if($page<1) $page=1;

	$perpage = 20;
	$start = ($page-1)*$perpage;

	//检查开始数
	ckstart($start, $perpage);

	$theurl = "space.php?uid=$_SGLOBAL[supe_uid]&do=mtag";

	$list = $tagids = array();
	
    $query = $_SGLOBAL['db']->query("SELECT main.*,field.* FROM ".tname('tagspace')." main 
        LEFT JOIN ".tname('mtag')." field ON field.tagid=main.tagid  
        WHERE field.fieldid=$fid AND field.tagtype=1 ORDER BY main.grade DESC LIMIT $start,$perpage");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        if(empty($value['pic'])) {
            $value['pic'] = 'image/nologo.jpg';
        }
        if($value['grade']>-2) {
            $tagids[$value['tagid']] = $value['tagid'];//已经批准的群组
        }
        $list[] = $value;
    }

	//分页
	$multi = multi($count, $perpage, $page, $theurl);
	
	realname_get();



}

?>
